package com.inspur.gs.sbssdl.sbwhgl.sbrh.sbrh.front.sbsslutaskselect_frm.voactions;
import com.inspur.edp.bff.api.manager.context.QueryContext;
import com.inspur.edp.bff.spi.action.query.BeforeQueryAction;
import com.inspur.edp.cef.entity.condition.EntityFilter;
import com.inspur.edp.cef.entity.condition.FilterCondition;

import java.util.ArrayList;

public class queryBeforeVOAction extends BeforeQueryAction {

	public queryBeforeVOAction(QueryContext context){
		super(context);
	}
	@Override
	public void execute() {
		String devId = (String) this.getContext().getVariableData().getValue("devId");

		if (devId != null && !devId.isEmpty()){
			EntityFilter filter = getQueryContext().getFilter();
			ArrayList<FilterCondition> filterList = new ArrayList<>(FilterCondition.builder()
					.andEqual("sbid", devId)
					.build());
			filter.addFilterConditions(filterList);
		}
	}
}
